/**
 * Copyright 2012 ibiblio
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0.txt
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Build environment settings
grails.project.work.dir = "target"
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"

grails.server.port.http = 8081

//grails.offline.mode = true

grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // uncomment to disable ehcache
        // excludes 'ehcache'
        //buildSettings.dependenciesExternallyConfigured = true
    }

    log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'

    //checksums false // Whether to verify checksums on resolve

    repositories {
        grailsPlugins()
        grailsHome()
        grailsCentral()

        //mavenRepo "http://mirrors.ibiblio.org/maven2/"

        // uncomment the below to enable remote dependency resolution
        // from public Maven repositories
        //mavenLocal()
        mavenCentral()
        //mavenRepo "http://snapshots.repository.codehaus.org"
        //mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
    }
    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
        compile 'joda-time:joda-time:2.1'

        compile 'org.mongodb:bson:2.7.3'

        // joda-time-hibernate 1.2 depends on conflicting old versions
        compile ('joda-time:joda-time-hibernate:1.2') {
            transitive = false
            excludes 'hibernate'
            excludes 'commons-logging'
            excludes 'ehcache'
        }

        // Special handling of antisamy dependency for sanatizer plugin
        compile ('org.owasp.antisamy:antisamy:1.4.4') {
            transitive = false
            excludes 'xercesImpl'
        }
        compile ('org.apache.xmlgraphics:batik-css:1.7') {
            transitive = false
            excludes 'xercesImpl'
        }

        compile ('org.apache.xmlgraphics:batik-ext:1.7') {
            transitive = false
            excludes 'xercesImpl'
        }
        //compile 'org.apache.xmlgraphics:batik-util:1.7'

        runtime 'postgresql:postgresql:8.4-702.jdbc4'
        runtime ('org.apache.solr:solr-solrj:3.5.0') {
            transitive = false
            excludes 'commons-logging'
            excludes 'slf4j'
        }

        // required for weceem, but not listed in weceem plugin dependencies
        runtime 'org.apache.ant:ant:1.7.1'
        runtime 'org.apache.ant:ant-launcher:1.7.1'
    }

    plugins {
        compile (':sanitizer:0.7.1') {
            transitive = false
            excludes 'commons-logging'
            excludes 'xml-apis'
            excludes 'xml-apis-ext'
            excludes 'xercesImpl'
            excludes 'tomcat'
        }
        compile (':jquery-ui:1.8.15') {
            excludes 'tomcat'
        }
        compile (':weceem:1.1.2') {
            excludes 'quartz'
            excludes 'feeds'
        }
    }

}
